package com.lc.demo.service.impl;

import com.lc.demo.bean.Department;
import com.lc.demo.mapper.DepartmentMapper;
import com.lc.demo.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: sakila
 * @Date: 2022/04/06/9:59
 * @Description:
 */
@Service
public class DepartmentServiceImpl  implements DepartmentService {

    @Autowired
    private DepartmentMapper departmentMapper;




    @Override
    public List<Department> getDepartmentList(Department department) {
        return departmentMapper.select(department);
    }

    @Override
    public void addDepartment(Department department) {
        departmentMapper.insert(department);
    }

    @Override
    public void updateDepartment(Department department) {
        departmentMapper.updateByPrimaryKeySelective(department);
    }

    @Override
    public void delDepartment(Department department) {
        departmentMapper.deleteByPrimaryKey(department.getId());
    }
}
